package com.hhu.webdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.widget.Toast;

import java.sql.DataTruncation;

public class MainActivity extends AppCompatActivity {


    public final  static String TAG = "webdemo.MainActivity";
    public final  static String webUrl = "file:///android_asset/index.html";

    WebView webView ;
    TWebHandler webHandler;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        webView = findViewById((R.id.web));
        webHandler = new TWebHandler(webView){
            @Override
            public void handleMessage(Message msg) {
                super.handleMessage(msg);
                if( msg.what==1000){
                    TCallData callData ;
                    if( msg.obj!=null){
                        callData = (TCallData)(msg.obj);
                    }
                    else{
                        callData = new TCallData();
                    }

                }
            }
        };
        webView.loadUrl(webUrl);
    }

}